using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_ColorAnimat_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.ColorAnimat);
            args = new Type[]{};
            method = type.GetMethod("get_Target", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_Target_0);
            args = new Type[]{};
            method = type.GetMethod("Play", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Play_1);
            args = new Type[]{typeof(System.Single)};
            method = type.GetMethod("Update", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Update_2);
            args = new Type[]{};
            method = type.GetMethod("Dispose", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Dispose_3);

            field = type.GetField("PlayOver", flag);
            app.RegisterCLRFieldGetter(field, get_PlayOver_0);
            app.RegisterCLRFieldSetter(field, set_PlayOver_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_PlayOver_0, AssignFromStack_PlayOver_0);
            field = type.GetField("StartColor", flag);
            app.RegisterCLRFieldGetter(field, get_StartColor_1);
            app.RegisterCLRFieldSetter(field, set_StartColor_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_StartColor_1, AssignFromStack_StartColor_1);
            field = type.GetField("EndColor", flag);
            app.RegisterCLRFieldGetter(field, get_EndColor_2);
            app.RegisterCLRFieldSetter(field, set_EndColor_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_EndColor_2, AssignFromStack_EndColor_2);


            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.ColorAnimat[s]);

            args = new Type[]{typeof(huqiang.Core.HGUI.HGraphics)};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* get_Target_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.ColorAnimat instance_of_this_method = (huqiang.ColorAnimat)typeof(huqiang.ColorAnimat).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.Target;

            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* Play_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.ColorAnimat instance_of_this_method = (huqiang.ColorAnimat)typeof(huqiang.ColorAnimat).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Play();

            return __ret;
        }

        static StackObject* Update_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Single @time = *(float*)&ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.ColorAnimat instance_of_this_method = (huqiang.ColorAnimat)typeof(huqiang.ColorAnimat).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Update(@time);

            return __ret;
        }

        static StackObject* Dispose_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.ColorAnimat instance_of_this_method = (huqiang.ColorAnimat)typeof(huqiang.ColorAnimat).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Dispose();

            return __ret;
        }


        static object get_PlayOver_0(ref object o)
        {
            return ((huqiang.ColorAnimat)o).PlayOver;
        }

        static StackObject* CopyToStack_PlayOver_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.ColorAnimat)o).PlayOver;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_PlayOver_0(ref object o, object v)
        {
            ((huqiang.ColorAnimat)o).PlayOver = (System.Action<huqiang.ColorAnimat>)v;
        }

        static StackObject* AssignFromStack_PlayOver_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Action<huqiang.ColorAnimat> @PlayOver = (System.Action<huqiang.ColorAnimat>)typeof(System.Action<huqiang.ColorAnimat>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)8);
            ((huqiang.ColorAnimat)o).PlayOver = @PlayOver;
            return ptr_of_this_method;
        }

        static object get_StartColor_1(ref object o)
        {
            return ((huqiang.ColorAnimat)o).StartColor;
        }

        static StackObject* CopyToStack_StartColor_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.ColorAnimat)o).StartColor;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_StartColor_1(ref object o, object v)
        {
            ((huqiang.ColorAnimat)o).StartColor = (UnityEngine.Color)v;
        }

        static StackObject* AssignFromStack_StartColor_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Color @StartColor = (UnityEngine.Color)typeof(UnityEngine.Color).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            ((huqiang.ColorAnimat)o).StartColor = @StartColor;
            return ptr_of_this_method;
        }

        static object get_EndColor_2(ref object o)
        {
            return ((huqiang.ColorAnimat)o).EndColor;
        }

        static StackObject* CopyToStack_EndColor_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.ColorAnimat)o).EndColor;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_EndColor_2(ref object o, object v)
        {
            ((huqiang.ColorAnimat)o).EndColor = (UnityEngine.Color)v;
        }

        static StackObject* AssignFromStack_EndColor_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Color @EndColor = (UnityEngine.Color)typeof(UnityEngine.Color).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            ((huqiang.ColorAnimat)o).EndColor = @EndColor;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Core.HGUI.HGraphics @img = (huqiang.Core.HGUI.HGraphics)typeof(huqiang.Core.HGUI.HGraphics).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);


            var result_of_this_method = new huqiang.ColorAnimat(@img);

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
